<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="jgp/css/project/ui-color-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-list-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-input-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-btn-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-res-v3.css">
    <link rel="stylesheet" href="jgp/css/ui-color.css">
    <link rel="stylesheet" href="jgp/css/ui-res.css">
    <link rel="stylesheet" href="jgp/css/ui-input.css">
    <link rel="stylesheet" href="jgp/css/ui-base.css">
    <link rel="stylesheet" href="jgp/css/ui-box.css">
    <link rel="stylesheet" href="jgp/css/project/style.css">
	<link rel="stylesheet" href="jgp/css/my.css">
		
	<script src="jgp/js/jquery-1.8.3.min.js"></script>
	<script src="jgp/js/zy_control.js"></script>
	<script src="jgp/js/md5.js"></script>
	<script src="jgp/js/zy_click.js"></script>
	<script src="jgp/js/common.js"></script>
	<script src="jgp/js/pbd.js"></script>
	<script src="jgp/js/recyclelist.js"></script>
	<script src="js/talkingdata.js"></script>
<h1></h1></head>
<!--初始化数据加载本地数据-->
<body class="um-vp c-wh" onclick >
    <div id="page_0" class="up ub ub-ver" tabindex="0">
        <!--header开始-->
       <div id="header" class="uh c-m1 t-wh ub ub-ac">
        	<div id="" class="uh c-bla0 t-wh ub">
            	<div class="umw4 ub ub-ac ub-pc" id="back" onclick="zy_touch('btn-act')">
            		<!--按钮开始-->
					<div class="btn  uc-a resback umh1-7 umw1-7 ub-img8"  ></div>
					<!--按钮结束-->
            	</div>
                    <h1 class="ut ub-f1 uinn ulev0 ut-s tx-c" tabindex="0">
	                    <div >回收单</div>
					</h1>
				<div class="umw4 ub ub-ac ub-pc" onclick="zy_touch('btn-act')" onclick="">
					<!--按钮开始-->
					<div class="btn uinn2 uc-a " onclick="uploadHs('updateDate1(0)')"><font style="font-weight:800">提交</font></div>
					<!--按钮结束-->
				</div>
            </div>
        </div>
		
		<div class="ub ub-ver t-bla c-blu5" id="div2">
				  <!--块容器开始-->
					<div class="ub  t-bla ">
					    <div class="umw29 uinn ub-f1 uc-l1">
					    	<div class="ub-f1  uc-r1 ub ub-ac ub-pc t-wh tx-l">
						    <div class="ub  c-gra ulev-1  uc-a4 t-bla">
						    <div  class="ub-f1 uinn ulev0 uc-l1">航班号:</div>
						    <div  class="ub-f1 uinn ulev0 uc-r1"  id="hbh"></div>
						    </div>
						    </div>
					    </div>
					    <div class=" uc-r1 umw60">
						  <!--下拉列表开始-->
							<div class="ub t-bla uinn">
							    <div class="ub-f1 ub uba c-wh b-gra  sel">
							        <div class="ub-f1 ut-s uinn ulev-1 tx-l ulh-sel" id="kfmc">请选择库房</div>
							        <div class=" b-gra c-06 umw2 ub ub-pc ub-ac">
							            <div class="ub-img umw1 umh1 res3"></div>
							        </div>
							        <select name="sel0" id="pbk" onchange="zy_selectmenu(this.id)">
							        	<option value="" class="">请选择库房</option>
							        </select>
							    </div>
							</div>
							<!--下拉列表结束-->
					    </div>
					</div>
					<!--块容器结束-->
        </div>
		
		<div class=" c-blu5 " id="div4">
			
		    <ul  class="uc-t ub t-bla ub-ac umar-l">
		    	<li class="btn  umh1-7 uinn3  umw1-7 ub-img5" ></li>
				<li class="btn umar-l  res28 umh1-7 uinn  umw1-7 ub-img5" onclick="openScan()"></li>
				<li class="btn  umh1-7 uinn ub-img5" ></li>
		        <li class="ub-f1  ut-s umar-l t-bla " id=""></li>
				<li class="btn   umh1-7 uinn3 umw1-1 ub-img" ></li>  
		        <li class="tx-c t-bla umar-l umw33 ">
		        <div class=" uinput uinn4  ub ub-ac ub-pc"  >
		        <input type="text" class="uc-a1 tx-c " readonly value="回收"></div></li>
		        <li class="btn  umh1-7 uinn3 umw33 umw1-7 ub-img" ></li>
			</ul>
		</div>
        <!--header结束--><!--content开始-->
        <div id="content" class="ub-f1 tx-l bj3  ub-img1 ">
        </div>
        <!--content结束-->
    </div>
	<div id="diyLoadDiv" class="uhide" ></div>
</body>
<script>
 zy_init();
window.uexOnload = function(type){
	if (!type) {
		getkfData();
//		uexQRCode.cbStartActivityForResult = scanFunc;
		$$("hbh").innerHTML = getStorage("HBH");
		zy_con("content", "jgp_recycleList_content.html", 0, $$("header").offsetHeight + $$("div2").offsetHeight + $$("div4").offsetHeight);
	}
}
//	window.onorientationchange=window.onresize=function(){
//		zy_resize("content",0,$$("header").offsetHeight+$$("div2").offsetHeight+$$("div4").offsetHeight);				
//	 }
//   }
   //返回按钮
   var c=new zyClick("back",function(me){
//   	        uexWindow.evaluateScript("FlightJGP",'0',"myrefresh()");
   			uexWindow.close(-1);
			IC.talkingDataCount("机供品","0005");
//			 uexWindow.open("FlightJGPPeiDan", 0, "jgp_FlightJGPPeiDan.html", 1, "", "", 0);
			//点击返回按钮更新数据库
			},"btn-act");

		//提交按钮事件
		function uploadHs(src){
			IC.talkingDataCount("机供品","0005");
//			alert(src);
		if($("#pbk").val()==""){
			   loadingStart("请指定一个库房进行回收!", 1500);
			   $$("kfmc").className="ub-f1 ut-s uinn ulev-1 tx-l ulh-sel c-red";
			return;
		}else{
			setStorage("kfid",$("#pbk").val());
		uexWindow.evaluatePopoverScript("","content",src);
		}
    }
		
/******************得到库房数据******************/
	
	  function getkfData(){
		var kf = JSON.parse(getStorage("kf"));
				var len =kf.length;
				 for(var i=0;i<len;i++){
					var F_KFMC=kf[i].F_KFMC;
					var F_KFID=kf[i].F_KFID;
					$$("pbk").innerHTML+='<option value='+
					F_KFID+
					'>'+
					F_KFMC+
					'</option>';
					}
			if(getStorage("kfid")==undefined){
			}else{
			$("#pbk").find("option[value='"+getStorage("kfid")+"']").attr("selected",true);  
			$$("kfmc").innerHTML=$("#pbk").find("option:selected").text();
			}		
	         }
			 
		function openScan(){
		var kf=	$("#pbk").val();
		if(kf==""){
			 loadingStart("请指定一个库房进行回收!", 1500);
			 $$("kfmc").className="ub-f1 ut-s uinn ulev-1 tx-l ulh-sel c-red";
			return;
		}else{
			var kfId=$("#pbk").val();
			setStorage("kfid",kfId);
		    uexQRCode.qrcode_scan();//打开扫码
		}
		}	 
			 
		function scanFunc(opCode, dataType, data){
	            var json = base64.decode(data);
				alert(json);
		        var usrname = JSON.parse(json).usrname;
				var usrid = JSON.parse(json).usrid;
				var pcode = JSON.parse(json).pcode;
				var salt='';
				 var date = new Date();
				var time = Math.floor(date.getTime()/1000/60/15);
				var mac=JSON.parse(json).mac;
				var uplaod=null;
				if(mac == hex_md5(usrname+pcode+time+salt)  || mac == hex_md5(usrname+pcode+(time-1)+salt)){
				   uplaod = {"usrname":usrname,"usrid":usrid,"pcode":pcode,"salt":salt,"mac":mac,"err":0};
		           uploadHs('updateDate1('+JSON.stringify(uplaod)+')');
 loadingStart("成", 3000);
				}else{
				   loadingStart("二维码已经失效,请获取有效二维码!", 3000);
				   uplaod = {"usrname":usrname,"usrid":usrid,"pcode":pcode,"salt":salt,"mac":mac,"err":1};
		           uploadHs("updateDate1('"+JSON.stringify(uplaod)+"')");
				} 
				
	    }
</script>
</html>
